<?php
	session_start();
	
	if(isset($_SESSION["giohang"]) && isset($_GET["id"]))
	{
		$id = $_GET["id"];
		for($i = 0; $i < count($_SESSION["giohang"]); $i++)
		{
			if($_SESSION["giohang"][$i] == $id && empty($_SESSION["giohang"]) == false)
			{
				break;
			}	
		}
		
		//Don mang
		for($j = $i; $j < count($_SESSION["giohang"]) - 1; $j++)
		{
			$_SESSION["giohang"][$j] = 	$_SESSION["giohang"][$j + 1];
			$_SESSION["soluong"][$j] = 	$_SESSION["soluong"][$j + 1];
		}
		
		array_pop($_SESSION["giohang"]);
		array_pop($_SESSION["soluong"]);
	}
	
	header("location:".$_SESSION["urlHienTai"]);
?>